﻿<%@ Page Language="C#" MasterPageFile="~/Views\Home\test.master" Inherits="System.Web.Mvc.ViewPage" %>
 		<asp:Content ContentPlaceHolderID="test" runat="server">
 			<div class="tab_container">
   				 <div class="tab_content">
   				  	<div class="sub_content">REGISTRATIONS</div>
   				  	<div class="error" id="reg_error">Cannot add user! Username already taken.</div>
   				  	<div class="success" id="reg_success">User added!</div>
   				  	<div class="success" id="reg_successs">User registration deleted!</div>
   				  	<% if ((int)ViewData["number"] > 0) { %>
   				  	<table width="100%" cellspacing="0">
   				  		<thead>
   				  			<td>Username</td>
   				  			<td>First Name</td>
   				  			<td>Last Name</td>
   				  			<td>Email</td>
   				  			<td>Contact Number</td>
   				  			<td>Level</td>
   				  			<td style="width: 150px;"></td>
   				  		</thead>
   				  		<tbody>
   				  		<% foreach (TestProject.Signup item in (ViewData["Registrations"] as List<TestProject.Signup>)) {%>
							<tr id="<%= Html.Encode(item.signup_ID) %>_row">
								<td align="center" id="<%= Html.Encode(item.signup_ID) %>_username"><%= Html.Encode(item.username) %></td>
								<td align="center" id="<%= Html.Encode(item.signup_ID) %>_firstname"><%= Html.Encode(item.firstname) %></td>
								<td align="center" id="<%= Html.Encode(item.signup_ID) %>_lastname"><%= Html.Encode(item.lastname) %></td>
								<td align="center" id="<%= Html.Encode(item.signup_ID) %>_email"><%= Html.Encode(item.email) %></td>
								<td align="center" id="<%= Html.Encode(item.signup_ID) %>_contactnumber"><%= Html.Encode(item.contactnumber) %></td>
		   				  		<!-- TODO: adjust column width -->
		   				  		<td width="10%" align="center" id="<%= Html.Encode(item.signup_ID) %>_levels"><select style="width:80px;" class="mb_input" id="<%= Html.Encode(item.signup_ID) %>_level" name="<%= Html.Encode(item.signup_ID) %>_level" >
		   				  			<option>User</option>
		   				  			<option>Librarian</option>
		   				  			<option>Admin</option>
		   				  		</select></td>
								<td align="center"><a href="#" class="approve_reg" id="<%= Html.Encode(item.signup_ID) %>" >Approve</a>&nbsp;|&nbsp;<a href="#" class="reject_reg" id="<%= Html.Encode(item.signup_ID) %>" >Reject</a></td>
							</tr>
						<% } %>
						</tbody>
   				  	</table>
   				  	<% } else { %>There are no user registrations to be approved.<% } %>
   				 </div>   				 
   			</div>
 		</asp:Content>
 		<asp:Content ContentPlaceHolderID="menu" runat="server">
	 		<div id="menu_container">
	 		
	 			<p>Welcome  <%= Html.Encode(Session["fname"])+ ' ' + Html.Encode(Session["lname"]) %>!</p>
	 			<div style="border-bottom: #E2E1E1 1px solid; padding-top: 30px;">
	 				<br/>
	 			</div>
	 			<ul class="tabs">
	                <% if(Html.Encode(Session["level"]) == "3"){ %>
	                <li><a class="links" href="/User/Index">Search Books</a></li>
	                <li><a class="links" href="/Librarian/UserAccount">View User's Account</a></li>
	                <li><a class="links" href="/Book/Manage">Manage Books</a></li>
	                <li class="active"><a class="links" href="/Librarian/ApproveRegistrations">Manage Registrations</a></li>
	                <li><a class="links" href="/Librarian/ManageUser">Manage User</a></li>
	                <%} %>
	                <li><a class="links" href="/User/Account">My Account</a></li>
	            </ul>
	            <div style="border-top: #FFF 1px solid;">&nbsp;</div>
	        </div>
 		</asp:Content>
 	
 	
